package com.aaa.stat.service.impl;

import com.aaa.entity.UUserInfo;
import com.aaa.stat.dao.UserInfoDao;
import com.aaa.stat.service.UserInfoService;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
* @author 祝云松
* @description 针对表【u_user_info】的数据库操作Service实现
* @createDate 2023-02-28 09:19:45
*/
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoDao, UUserInfo>
    implements UserInfoService {

    @Autowired
    private UserInfoDao userInfoDao;


    @Override
    public Result UserInfoAll(Integer currentPage, Integer pageSize, String startTime, String endTime) {

        Page<UUserInfo> objectPage = new Page<>(currentPage, pageSize);
        QueryWrapper<UUserInfo> wrapper = new QueryWrapper<>();
        if(startTime!="" && endTime!=""){
            wrapper.between("createtime",startTime,endTime);
        }
        Page<UUserInfo> page = userInfoDao.selectPage(objectPage, wrapper);
        return new Result(2000,"查询成功",page);
    }





    @Override
    public Result<Integer> code(Integer status ,String id ) {
        Integer code = userInfoDao.code(status, id);
        return new Result<>(2000,"修改成功",code);
    }


}




